package com.robotserver.orders.enums;

/**
 * @Auther: jianghan
 * @Date: 2019/11/11 16:31
 * @Description:
 */
public enum BizStatus {
    pay(0,"订单付款"),
    settlement(1,"订单结算"),
    pastdue(2,"订单失效"),
    refund(3,"维权退款"),
    invalid(4,"无效订单[未支付等情况]");
    private Integer value;
    private String desc;
    BizStatus(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    public Integer getValue() {
        return value;
    }
    public String getDesc() {
        return desc;
    }
    public static BizStatus getValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (BizStatus status: BizStatus.values()) {
            if (status.getValue() == value) {
                return status;
            }
        }
        return null;
    }
    public static String getDesc(Integer value) {
        if(getValue(value) == null){
            return null;
        }
        return getValue(value).getDesc();
    }
}
